package com.zhuiyi.yiqingbackend.common;

/**
 * 第三步：失败的时候，定义一些错误码
 */
public enum ErrorCode   {
    GET_FAIL(10004, "查询失败",""),
    UPDATE_FAIL(10003, "更新失败",""),
    DELETE_FAIL(10002, "删除失败",""),
    INSERT_FAIL(10001, "添加失败",""),
    DATA_NOT_EXIST(20005, "数据不存在",""),
    SUCCESS(20000,"ok",""),
    FAIL(20001,"fail",""),
    DATA_EXIST(20004,"数据已经存在",""),
    PARAM_ERROR(20003,"请求参数为空",""),
    NO_DATA(20002,"没有数据",""),
    PARAMS_ERROE(40000, "请求参数错误", ""),
    NULL_ERROE(40001, "为空错误", ""),
    NO_LOGIN(40100, "未登录", ""),
    NO_AUTH(40101, "没有权限", ""),
    SYSTEM_ERROR(50000, "系统内部异常", "");
    /**
     * 状态码
     */
    private final int code;
    /**
     * 状态码信息
     */
    private final String message;
    /**
     * 状态码详情
     */
    private final String description;

    public int getCode(){
        return code;
    }
    public String getMessage(){
        return message;
    }
    public String getDescription(){
        return description;
    }
     ErrorCode(int code, String message, String description) {
        this.code = code;
        this.message = message;
        this.description = description;
    }

}
